package cn.user.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import util.pageSupport;
import cn.user.dao.invitation.InvitationMapper;
import cn.user.pojo.Invitation;
import cn.user.pojo.reply_detail;
import cn.user.service.InvitationService;
@Service
public class InvitationServiceImpl implements InvitationService {
	
	@Autowired
	private InvitationMapper invitationMapper;
	
	@Override
	public List<Invitation> getAllInvitations() {
		// TODO Auto-generated method stub
		List<Invitation> list=new ArrayList<Invitation>();
		try {
			 list=this.invitationMapper.getInvitationList();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}

	@Override
	public List<Invitation> getPageInvitation(pageSupport page) {
		// TODO Auto-generated method stub
		List<Invitation> list=new ArrayList<Invitation>();
		
		list=this.invitationMapper.getPageInvitation(page);
		
		return list;
	}

	@Override
	public int getTotalCount() {
		// TODO Auto-generated method stub
		int count=this.invitationMapper.getTotalCount();
		return count;
	}


	public int replyDel(int invid) {
		// TODO Auto-generated method stub
		return this.invitationMapper.replyDel(invid);
	}

	@Override
	public int InviDel(int id) {
		// TODO Auto-generated method stub
		return  this.invitationMapper.InviDel(id);
	}

	@Override
	public List<reply_detail> getCommont(int invid) {
		// TODO Auto-generated method stub
		return this.invitationMapper.getCommont(invid);
	}

	@Override
	public int delComm(int id) {
		// TODO Auto-generated method stub
		return  this.invitationMapper.delComm(id);
	}
	

}
